package com.drojian.demo1.test5;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.drojian.demo.R;
import com.google.android.material.bottomsheet.BottomSheetDialog;

public class BottomSheetDialogActivity extends AppCompatActivity {
    private Button btnOpenBottomSheet;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.ui5_activity_bottom_sheet_dialog);

        Button back = findViewById(R.id.back);
        back.setOnClickListener(v->finish());

        btnOpenBottomSheet = findViewById(R.id.btn_open_bottom_sheet);
        btnOpenBottomSheet.setOnClickListener(v -> {
            BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
            View dialogView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_dialog, null);
            bottomSheetDialog.setContentView(dialogView);
//            bottomSheetDialog.set
            AppCompatButton button1 = dialogView.findViewById(R.id.bottom_sheet_button_1);
            button1.setOnClickListener(view -> {
            });

            AppCompatButton button2 = dialogView.findViewById(R.id.bottom_sheet_button_2);
            button2.setOnClickListener(view -> {
            });

            AppCompatButton button3 = dialogView.findViewById(R.id.bottom_sheet_button_3);
            button3.setOnClickListener(view -> {
            });

            bottomSheetDialog.show();
        });
    }
}